package org.xiyu.yee.beacon_anti_phantom.config;

import java.util.HashMap;
import java.util.Map;

public class BeaconConfig {
    private static BeaconConfig instance;
    
    // 信标等级对应的保护半径
    private final Map<Integer, Integer> beaconRadius = new HashMap<>();
    
    private BeaconConfig() {
        // 默认配置
        beaconRadius.put(1, 20);
        beaconRadius.put(2, 30);
        beaconRadius.put(3, 40);
        beaconRadius.put(4, 50);
    }
    
    public static BeaconConfig getInstance() {
        if (instance == null) {
            instance = new BeaconConfig();
        }
        return instance;
    }
    
    public int getRadius(int level) {
        return beaconRadius.getOrDefault(level, 0);
    }
    
    public void setRadius(int level, int radius) {
        beaconRadius.put(level, radius);
    }
    
    public Map<Integer, Integer> getAllRadius() {
        return new HashMap<>(beaconRadius);
    }
}
